package com.cssl.controller;

import com.cssl.User;
import com.cssl.feign.Userservice;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;
import java.util.Map;

@RestController
public class UserController {
    @Value("${server.port}")
    private String port;

    @Autowired
    private Userservice userservice ;
@RequestMapping("/index")
public ModelAndView index(ModelAndView modelAndView){
    modelAndView.setViewName("aa.html");
    return modelAndView;
}
    @RequestMapping("/selectAll")
    public String fi( String name1, String pwd1) throws InterruptedException {
        System.out.println(port+"aaa");

        System.out.println(name1+pwd1+"tokebn");
        String ss="";
        Map<String, Object> login = userservice.login(name1, pwd1);
        if(login!=null){
           ss="o";
        }else{
            ss="s";
        }
        return  ss;
    }
}
